package com.java.client;

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.java.entity.User;
import com.java.service.ICalculatorService;
import com.java.service.IUserService;  
  
/** 
* @ClassName: SpringUsersWsClient 
* @Description: TODO(这里用一句话描述这个类的作用) 
* @author undoner@gmail.com
* @date 2017年1月24日 上午10:20:03 
*/
public class SpringUsersWsClient {  
	private static final Logger logger = LoggerFactory.getLogger(SpringUsersWsClient.class);
    public static void main(String[] args) {  
        // 调用WebService  
    	logger.debug("#############Client IUserService##############");  
        JaxWsProxyFactoryBean userFactory = new JaxWsProxyFactoryBean();  
        userFactory.setServiceClass(IUserService.class);  
        userFactory.setAddress("http://localhost:8080/SpringCxfServer/user");
        
        IUserService userService = (IUserService) userFactory.create(); 
        User user = userService.getUserByName("hoojo");  
        logger.debug(user.getName());  
  
        userService.sayHi("undoner");  
        userService.setUser(user);  
       
    }  
}  
